class Timer {
   
    private static final byte RUN = 0;
    private static final byte WAIT = 1;
    private static final byte FINISHED = 2;
    private static final byte NOSTATE = 3;

    private byte state; 

    private long timeFinish, timeStartPause;

    //private boolean isPaused;
/*
    Timer() {
        unSet();
        isPaused = false;
    }
*/
    public void set(int time) {
        state = RUN;
        timeFinish = System.currentTimeMillis() + time;
    }

    public void unSet() {
        state = NOSTATE;
    }

    public boolean isFinished() {
        return state == FINISHED;
    }

    public void update() {
        if ((state == RUN) && (timeFinish <= System.currentTimeMillis())) {
            state = FINISHED;
        }
    }
/*
    public void pause() {
        if (!isPaused) {
            timeStartPause = System.currentTimeMillis();
            if(state == RUN) state = WAIT;
            isPaused = true;
        }
    }

    public void resume() {
        if (isPaused) {
            if (state == WAIT) {
                timeFinish += System.currentTimeMillis() - timeStartPause;
                state = RUN;
            }
            isPaused = false;
        }
    }
*/
}